package com.yic.module.base.api.supplier;

import cn.hutool.core.util.ObjectUtil;
import com.yic.module.base.api.supplier.dto.SupplierRespDTO;
import com.yic.module.base.convert.supplier.SupplierConvert;
import com.yic.module.base.dal.dataobject.supplier.SupplierDO;
import com.yic.module.base.service.supplier.SupplierService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @ClassName SupplierApiImpl
 * @Description 供应商api实现
 * @Author Lijx
 * @Date 2023/11/6 17:16
 * @Version 1.0
 */
@Service
public class SupplierApiImpl implements SupplierApi{

    @Resource
    private SupplierService supplierService;

    @Override
    public SupplierRespDTO getSupplier(Long id) {
        if (ObjectUtil.isNull(id)){
            return null;
        }
        SupplierDO supplier = supplierService.getSupplier(id);
        return SupplierConvert.INSTANCE.convert01(supplier);
    }
}
